package com.brutal.utils;

import com.rsbuddy.script.wrappers.Tile;

public class Node {

	public int x, y;
	public Node prev;
	public double g, f;

	public Node(int x, int y) {
		this.x = x;
		this.y = y;
		g = f = 0;
	}

	@Override
	public int hashCode() {
		return (x << 4) | y;
	}

	@Override
	public boolean equals(Object o) {
		if (o instanceof Node) {
			Node n = (Node) o;
			return x == n.x && y == n.y;
		}
		return false;
	}

	@Override
	public String toString() {
		return "(" + x + "," + y + ")";
	}

	public Tile toTile(int baseX, int baseY) {
		return new Tile(x + baseX, y + baseY);
	}
}